package com.hm.scala

import scala.util.control.Breaks._

object While {
  
  def main(args: Array[String]): Unit = {

    var i = 0;
    var sum = 0;
    breakable {
      while (i < 10) {
        i += 1;
        sum += i;

        if (i == 3) {
          break;
        }
      }
    }
    println(i + "-----------" + sum)
  }
}